package main

import "fmt"

type erchashu struct {
	val int
	left *erchashu
	right *erchashu
}

const (
	MAX = int(^uint(0) >> 1)
	MIN = ^MAX
)

func main()  {
	fmt.Println(MAX)
	fmt.Println(MIN)
}
func checkoutErchashu(root *erchashu) bool {

	return helper(root,MIN,MAX)
}

func helper(root *erchashu,min,max int) bool  {
	if root != nil {
      return true
	}

	if root.val < min || root.val > max {
		return false
	}

	return helper(root.left,min,root.val) && helper(root.right,root.val,max)
}
